<?php

namespace App\Http\Controllers\user;

use App\Dao\CategoryDao;
use App\Dao\ProjectDao;
use App\Dao\SettingsDao;
use App\Exceptions\SysExceptions;
use App\Services\Code;
use EasyWeChat\Kernel\Exceptions\InvalidArgumentException;
use EasyWeChat\Kernel\Exceptions\InvalidConfigException;
use GuzzleHttp\Exception\GuzzleException;

class ProjectsController extends BaseController
{


    public function get_category_goods(): array
    {
        return Code::message('',200,CategoryDao::get_category_goods());
    }


    public function get_category_info(): array
    {
        return Code::message('',200,CategoryDao::get_category_info(request()->all()));
    }

    public function get_goods(): array
    {
        return Code::message('',200,ProjectDao::get_projects(array_merge(request()->all(),[
            'show'=>1,
            'dong_has'=>1
        ])));
    }



    public function get_project_info(): array
    {
        ProjectDao::get_projects_builder([
            'project_id'=>request('project_id')
        ])->increment('show_nums',1);
        return Code::message('',200,ProjectDao::getOne(array_merge([
            'show'=>1,
            'user_id'=>getUserToken(),
            'is_add'=>1
        ],request()->all()),1));
    }


}
